
//异步加载更多内容
    var offset2 = 1;
$("#pagination a").click(function()
{   
    var content = $('#new_experience').children();
    $.ajax({
        type:'get',
        url:'<{:U('Index/new_experience')}>',
        async:false,
        data:"offset2=" + offset2,
        success:function(new_data){
          if (new_data == null ){
            $('#pagination').replaceWith('<div class="news-more" id="pagination">已无更多</div>');
          }
            offset2 ++;
            //将父类信息 追加到 下拉框中
            //先清空原先的数据
            // //遍历父类数据
            for (var i = 0; i < new_data.length; i++) {
                $('<div class="news-list"><div class="news-img col-xs-5 col-sm-5 col-md-4"> <a target="_blank" href="123"><img src="'+new_data[i]._s_picture+'" alt=""> </a> </div><div class="news-info col-xs-7 col-sm-7 col-md-8"><dl><dt> <a href="" target="_blank" class="new_title"> '+new_data[i].title+' </a> </dt><dd><span class="name"><a href="" title="'+new_data[i].uname+'的主页" rel="author">'+new_data[i].uname+'</a></span> <span class="identity"></span> <span class="time pull-right">'+new_data[i].ctime+'</span></dd><dd class="text">'+new_data[i].intro+'</dd></dl><div class="news_bot col-sm-7 col-md-8"> <span class="tags visible-lg visible-md"> <a href="">收藏</a> </span> <span class="look"> <span class="glyphicon glyphicon-hand-right"></span>&nbsp;有用（'+new_data[i].g_count+'） </span> </div></div>').appendTo('#new_experience');
                var length = $('.news-list .news-img a').length;
                var n = length - 1;
                $('.news-list .news-img a').eq(n).attr('href','/index.php/Home/content/index/id/'+new_data[i].id+'');
                var href = $('.news-list .news-info .new_title').eq(n).attr('href','/index.php/Home/content/index/id/'+new_data[i].id+'');
            };

        },
        dataType:'json',
    })
});



    setInterval(setInterval(function(){
        // 获取title中的内容
        var titleStr = document.title;
        // 取第一个字符
        var firstChar = titleStr.charAt(0);
        // 截取出 除了第一个字符以外的所有字符
        var lastChar = titleStr.substr(1);
        // 重写拼装好的字串赋值给titile
        document.title = lastChar + firstChar;
    },300),100)


//换一下

    var offset = 1;
    $('#change').click(function(){
      var content = $('#hot_experience').children();
      console.log(offset);
      $.ajax({
          type:'get',
          url:'<{:U('Index/hot_experience')}>',
          async:false,
          data:"offset=" + offset,
          success:function(data){
              offset ++;
              if (offset == 2) {
                offset = 0;
              }
              //将父类信息 追加到 下拉框中
              //先清空原先的数据
              $('#hot_experience').empty();
              // //遍历父类数据
              // $('<option value= -1>请选择</option>').appendTo('#one');
              for (var i = 0; i < data.length; i++) {
                  $('<ul><li ><span class="hot_experience"><a href="" target="_blank" class="picture_href"><img src="'+data[i]._s_picture+'" alt=""></a><h3> <div class="mt3"><span class="overflow"><b>·&nbsp;</b><a href="" target="_blank">'+data[i].title+'</a></span><br>&nbsp;&nbsp;&nbsp;<span class="qianse"><a href="" target="_blank">'+data[i].uname+'</a></span><span class="pull-right none qianse"><span class="glyphicon glyphicon-hand-right none"></span>&nbsp;有用（'+data[i].g_count+'）</span></div></h3></span></li></ul>').appendTo('#hot_experience');
                  $('#hot_experience h3 .overflow a').eq(i).attr('href','/index.php/Home/content/index/id/'+data[i].id+'');
                  $('#hot_experience .picture_href').eq(i).attr('href','/index.php/Home/content/index/id/'+data[i].id+'');
              };

          },
          dataType:'json',
      })
    });


